
import { _decorator, Component, Node, Label, ProgressBar, EventTouch } from 'cc';
import { UIManager } from '../../../framework/manager/uiManager';
import { Constant } from '../../../Enum/Enum';
const { ccclass, property } = _decorator;

@ccclass('UpdatePanel')
export class UpdatePanel extends Component {

    @property(Label)
    info: Label = null;// 热更新过程中的提示信息

    @property(ProgressBar)
    fileProgress: ProgressBar = null;// 文件下载数量进度条
    @property(Label)
    fileLabel: Label = null;
    @property(ProgressBar)
    byteProgress: ProgressBar = null;// 字节下载进度条
    @property(Label)
    byteLabel: Label = null;
    @property(Node)
    close: Node = null;// 关闭面板按钮挂载
    @property(Node)
    checkBtn: Node = null;// 按钮 检查更新
    @property(Node)
    retryBtn: Node = null;// 按钮 下载更新重试
    @property(Node)
    updateBtn: Node = null;// 按钮 开始更新

    protected onEnable(): void {
        this.node.on(Node.EventType.TOUCH_END, (event) => { console.log("hotupdate updatePanel emit TOUCH_END"); }, this);
    }
    protected onDisable(): void {
        this.node.off(Node.EventType.TOUCH_END);
    }

    show() {
        console.log("hotupdate updatePanel show");
        this.retryBtn.active = false;
        // this.updateBtn.active = false;
    }

    btn_close() {// 关闭热更新面板按钮
        UIManager.instance.hideDialog(Constant.PANEL_NAME.HOT_UPDATE_PANEL);
    }


}
